home *** CD-ROM | disk | FTP | other *** search
Wrap
/* v1.07 AddSpace B Marko Seppänen marko.seppanen@wwnet.fi */ address IMAGEENGINEER Options results signal on error /* Setup a place for errors to go */ if arg()=0 then exit x=arg(1) parse var x pic bg side value . MARK pic PRIMARY PROJECT_INFO pic WIDTH picwidth=result PROJECT_INFO pic HEIGHT picheight=result PROJECT_INFO pic ZOOM origzoomval=result if bg="" then do if exists("ie:prefs/veaddspaceb.cfg") == "1" then do call open("temp","ie:prefs/veaddspaceb.cfg","R") values=readln("temp") parse var values ok bg side value . call close("temp") end else do bg=0 side=0 value=100 end 'FORM "Add Space B" "Use|Cancel"', 'CYCLE,"Background color","White|Black|Guess",'bg'', 'CYCLE,"Side","Top|Bottom|Left|Right",'side'', 'INTEGER,"Space to add",1,1000,'value',SLIDER' values=result parse var values ok bg side value . if ok = 0 then exit call open("temp","ie:prefs/veaddspaceb.cfg","W") res=writeln("temp",values) call close("temp") end select when side=="0" | upper(side)=="TOP" then do offsetx=0 offsety=value xamount=0 yamount=value end when side=="1" | upper(side)=="BOTTOM" then do offsetx=0 offsety=0 xamount=0 yamount=value end when side=="2" | upper(side)=="LEFT" then do offsetx=value offsety=0 xamount=value yamount=0 end when side=="3" | upper(side)=="RIGHT" then do offsetx=0 offsety=0 xamount=value yamount=0 end otherwise exit end if value=="" then do 'REQUEST "Value is missing!" "Sorry"' exit end select when bg == 0 | upper(bg)=="WHITE" then do BRIGHTNESS pic 255 bgcolor=result RESIZE bgcolor picwidth+xamount picheight+yamount TILE bgcolor2=result CLOSE bgcolor MARK bgcolor2 SECONDARY COMPOSITE offsetx offsety MIN pic2=result end when bg == 1 | upper(bg)=="BLACK" then do BRIGHTNESS pic "-255" bgcolor=result RESIZE bgcolor picwidth+xamount picheight+yamount TILE bgcolor2=result CLOSE bgcolor MARK bgcolor2 SECONDARY COMPOSITE offsetx offsety MAX pic2=result end when bg == 2 | upper(bg)=="GUESS" then do CROP pic picwidth-1 picheight-1 picwidth-1 picheight-1 bgpixel=result RESIZE bgpixel picwidth+xamount picheight+yamount TILE bgcolor2=result CLOSE bgpixel MARK bgcolor2 SECONDARY COMPOSITE offsetx offsety MIX 100 pic2=result end otherwise exit end CLOSE bgcolor2 PROJECT_SET pic2 ZOOM origzoomval exit /*******************************************************************/ /* This is where control goes when an error code is returned by IE */ /* It puts up a message saying what happened and on which line */ /*******************************************************************/ error: if RC=5 then do /* Did the user just cancel us? */ IE_TO_FRONT LAST_ERROR 'REQUEST "'||RESULT||'"' exit end else do IE_TO_FRONT LAST_ERROR 'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!' exit end